package com.yan.demo.demo3;

/**
 * @author taoge
 * @Date 2024/8/8 14:52
 * @Description 测试类
 */
public class Demo3 {
    public static void main(String[] args) {
        Product product = new Product();
        Stack stack = new Stack(product , false);
        MyTask1 myTask1 = new MyTask1(stack);
        MyTask2 myTask2 = new MyTask2(stack);
        Thread t1 = new Thread(myTask1 , "生产者A");
        Thread t2 = new Thread(myTask2 , "消费者A");
        Thread t3 = new Thread(myTask1 , "生产者B");
        Thread t4 = new Thread(myTask2 , "消费者B");

        t1.start();
        t2.start();
        t3.start();
        t4.start();

    }
}
